package com.pattern.deno.decorator.concretedecorators;

import com.pattern.deno.component.Beverage;
import com.pattern.deno.decorator.CondimentDecorator;

import java.math.BigDecimal;

/**
 * @ClassName: Soy
 * @Description:    豆浆调料
 * @Date: 2020/8/28 14:17
 * @Author: Song JinGen
 */
public class Soy extends CondimentDecorator {

    public Soy(Beverage beverage) {
        super(beverage);
    }

    @Override
    public String getDescription() {
        return beverage.getDescription() + ", 豆浆";
    }

    @Override
    public BigDecimal cost() {
        return new BigDecimal("0.15").add(beverage.cost());
    }
}
